package com.net.jef.dal.dao.ibatis;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.net.jef.dal.common.BaseDAOIBatis;
import com.net.jef.dal.dao.CategoryDAO;
import com.net.jef.dal.dateobject.CategoryDO;

@Repository("categoryDAO")
public class CategoryDAOIBatis extends BaseDAOIBatis implements CategoryDAO {

    public CategoryDO loadCategory(long id) {
        CategoryDO cat = (CategoryDO) this.getSqlMapClientTemplate()
                .queryForObject("CATEGORYDO-load", id);
        return cat;
    }

    public List<CategoryDO> getAllCategory() {
        List<CategoryDO> list = this.getSqlMapClientTemplate().queryForList(
                "CATEGORYDO-getAll");
        return list;
    }

}
